#include <QgsSimulation/DrawPointTools.h>

using SimulationCore::QgsSimulation::DrawPointTools;

DrawPointTools::DrawPointTools(QgsMapCanvas* mapcanvas, const QString& action)
	:QgsMapToolEmitPoint(mapcanvas),
	mapcanvas_(mapcanvas), action_(action)
{
	this->crs_ = this->mapcanvas_->mapSettings().destinationCrs();
}


void DrawPointTools::canvasPressEvent(QgsMapMouseEvent* e)
{
	if (e->button() == Qt::LeftButton) {
		auto geometry = QgsGeometry::fromPointXY(e->mapPoint());
		emit drawGeometry(this->action_, QgsWkbTypes::Type::Point, geometry,true);
	}
}

void DrawPointTools::canvasDoubleClickEvent(QgsMapMouseEvent* e)
{
}


void DrawPointTools::deactivate()
{
	QgsMapToolEmitPoint::deactivate();
}
